package org.example.com.kotlinlab.delegate.property_delegate.observable_delegate.demo01

import kotlin.properties.Delegates

class User {
    var name: String by Delegates.observable("Init Value") { property, oldValue, newValue ->
        println("$oldValue -> $newValue")
    }
}

fun main() {
    val user = User()
    println(user.name)
    println(user.name)

    user.name = "New Name"
    println(user.name)
    println(user.name)
}